<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>登录</title>
<link rel="stylesheet" type="text/css" href="/style/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/xshop.css?ver=20180810" />
<script src="/style/js/jquery-1.12.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/xShop.js" type="text/javascript" charset="utf-8"></script>
<style>
.meinner-adr-add{
 background-image:url('/style/images/login/login_bg.jpg');
 background-size: cover;
 background-position: center;
 background-repeat: no-repeat;
}

/* .btnwrap .btn-mexl{
background: #999;
color: #fff;
} */

.iptform{
	 background-color:transparent!important;
}
.btnwrap .btn-mexl.active{
	border-radius: 1rem;
background: #61a307;
color: #fff;
}
.iptform .item-ipt{
	margin-left: 0.5rem!important;
	margin-top:0.5rem!important;
	color:#fff!important;
	height: .6rem;
    line-height: .6rem;
}

.iptform .item-ipt span.name{

font-size: .32rem;
}

.iptform .item-ipt .btn-huoqu {

    border-radius: 1rem;
	top:.2.2rem!important;
    right: .3rem!important;
    


}

.iptform .item-ipt .txtpla {
	display:block;
    margin-left: 1rem;
    font-size: .32rem;
	 background-color:  transparent;

}
input[placeholder], [placeholder], *[placeholder] { 
	
    color:#fff!important; 
	 
} 
 input::-webkit-input-placeholder {
     /* placeholder颜色  */
        color: #fff;
    }
.iptform .agreen::before{
	
	width:.45rem; 
	height:.45rem;
}

.fenlei-search-icon {
    width: .3rem;
    height: .3rem;
    margin: 0.1rem .12rem 0 0.4rem;
    float: left;
}
</style>
</head>
<body>
<div class="outwrap">
	<!--top-->	
	<!-- <div class="topbar clearfix topvh">
		<a href="/mystore/account_manage" class="btn-back">
			<i class="ico-back"></i><span>更改手机号</span>
		</a>
	</div> -->
   <div class="meinner-adr-add"  >
    <div class="iptform iptformm30">
    <form action="" method="post">
    
      <div class="item-ipt" style="margin-top:5rem!important; border:1px solid #ffffff ;border-radius:.4rem;" >
       <img class="fenlei-search-icon" src="/style/images/login/login-ico-2.png"/>
        <input type="tel" maxlength="11" placeholder="请填写11位手机号码" class="txtpla" name="mobile" id="mobile"/>
      </div>
     
      <div class="item-ipt"  style="border:1px solid #ffffff ;border-radius:.4rem;" >
         <img class="fenlei-search-icon" src="/style/images/login/login-ico-1.png"/>
        <input type="tel" maxlength="6" id="check_code" placeholder="请填写短信验证码" class="txtpla" /><a href="javascript:_getsmscode();" class="btn-huoqu" >获取</a>
      </div>      
     
    </div>
    <div class="btnwrap">
     
      <input type="button" class="btn-mexl btn-bc active" id="sub_btn" value="登录" />
     
    </div>
    <div style="width: 100%; height: auto;  font-size: .36rem;">
         <a href="/passport/register" style="padding:0.5rem;color: #fff;">注册新用户</a>
    </div>
  </div>
</div>
<script type="text/javascript" src="/style/js/sweet-alert.min.js"></script>
<link type="text/css" rel="stylesheet" href="/style/css/sweet-alert.css">
<script>

$(document).ready(function() {
    $("#sub_btn").click(function() {

      if( $(this).hasClass("active") )
      {
          if ($("#mobile").val() == "") {
            swal("手机号码不能为空");
            return false;
          }
          
    /*      if ($("#check_code").val() == "") {
              swal("请填写短信验证码");
              return false;
          }*/

         
      
          $.post("ajax", {
              "act": "login",
              "mobile": $("#mobile").prop("value"),
              "smscode": $("#check_code").prop("value"),
              "mr": Math.random()
          }, function(data) {
              if (data.code == 200) {
                    
                 window.location.href = "/";
                
              }else{
                  swal(data.msg, false, "error");
              } 
              
          }, 'json');
      }

        
    });
});
var _smscodeStat = false,
    _smscodeSec = 60,
    parm = /^(13|14|15|16|17|18|19)+([0-9]{9})$/;

function _smscodeTimer() {
    if (_smscodeStat && _smscodeSec > 0) {
        $(".btn-huoqu").html(_smscodeSec + '秒后重发');
        _smscodeSec -= 1;
        setTimeout("_smscodeTimer();", 1000);
    } else {
        _smscodeStat = false;
        _smscodeSec = 60;
        $(".btn-huoqu").html('获取');
    }
}

function _getsmscode() {
    if (!_smscodeStat) {
        var _do = true;
        if ($("#mobile").prop("value") == "") {
            swal("请填写手机号码");
            _do = false;
        } else if (!parm.test($("#mobile").prop("value"))) {
            swal("手机号码格式不正确");
            _do = false;
        }
        if (_do) {
            $.post("ajax", {
                "act": "sendsmscode",
                "mobile": $("#mobile").prop("value"),
                "mr": Math.random()
            }, function(msg) {
                console.log(msg);
                if (msg.code == 200) {
                    _smscodeStat = true;
                    _smscodeTimer();
                    swal("验证码已发送!");
                } else if (msg.code == 404) {
                    swal("手机号码未注册");
                } else if (msg.code == 403) {
                    swal("保存验证码失败");
                } else if (msg.code == 409) {
                    swal("验证码发送失败");
                } else if (msg.code == 900) {
                    swal("手机号码错误");
                } else {
                    swal("发送验证码失败");
                }
            },"json");
        }
    }
}
</script>
</body>
</html>
